home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / MODULES / LINEEDIT.SPK / Rebinder (.txt) < prev    next >
RISC OS BBC BASIC V Source  |  1996-09-04  |  2KB  |  126 lines

  1.  >Rebinder
  2. "This program modifies the LineEditor module on disk to"
  3. "change the key bindings."
  4. '"You need to input the name of the file with the new"
  5. "keybindings in."'
  6. $M$="<LineEditor$Dir>.LineEditor"
  7.  M$:len%=
  8.  v$,N%
  9.  T$(N%)
  10.  C% N%, M% len%
  11.  "OS_File",&FF,M$,M%,0
  12. T%=M%+len%-512
  13.  L%=0 
  14.  N%-1
  15.  T$(L%),C%?L%
  16.  T$(L%)="vanilla" v%=L%
  17.  v%=-1 
  18. "No vanilla in key table":
  19. z(M%+M%!20),"Line Editor"+
  20. 9+v$)<>1 
  21. "Incorrect key file version for module":
  22.  "Key definitions file (RETURN for default): "F$
  23.  F$="" F$="<LineEditor$Dir>.DfltKeys"
  24. WS$=" "+
  25. ::DIM XXX% 512:FOR L%=0 TO 511:XXX%?L%=T%?L%:NEXT
  26.  L%=0 
  27.  511:T%?L%=C%?v%:
  28. L$,"&")
  29.   T$=
  30. L$,I%)
  31.  HACKARAMA
  32. !1  I%=
  33. T$,"-"):
  34.  I% T$=
  35. T$,I%-1)+"~"+
  36. T$,I%+1)
  37.   K%=
  38. T$:K2%=K%
  39. T$,2)
  40. "0123456789ABCDEFabcdef",
  41. T$,1))=0 
  42.  T$=""
  43. T$,1)="~" 
  44.    T$=
  45. T$,2)
  46. T$,1)<>"&" T$="&"+T$
  47.    K2%=
  48. T$,2)
  49. *4   
  50. "0123456789ABCDEFabcdef",
  51. T$,1))=0 
  52.  T$=""
  53. T$,1)) 
  54.  T$<>""
  55.    T$=
  56. T$,2)
  57.  T$ is the action token for key codes K% to K2%
  58.  force to upper-case
  59. 13  t$=T$:T$="":
  60.  L%=1
  61. t$:T$+=
  62. t$,L%,1)
  63.   t%=0
  64.  T$<>T$(t%) 
  65.  t%<N%
  66.    t%+=1
  67.  t%=N% 
  68. "Bad TOKEN '"T$"'":
  69.  K%<0 
  70.  K%>&1FF 
  71.  K2%<0 
  72.  K2%>&1FF 
  73. "Bad key number":
  74. ::PRINTK%"-";K2%" ";t%
  75.  L%=K% 
  76.  K2%:T%?L%=C%?t%:
  77.  "OS_File",&0A,M$,&FFA,,M%,M%+len%
  78.  "OS_Module",11,M%,len%
  79. ::FOR L%=0 TO 511:IF XXX%?L%<>T%?L% PRINTL%" ";XXX%?L%"->";T%?L%:N.ELSEN.
  80. z(A%):
  81.  ?A%:A$+=
  82. ?A%:A%+=1:
  83.  >KEYLIB
  84.  2.71
  85.  ignore,46
  86.  beepignore,55
  87.  left,1
  88.  right,5
  89.  delword,88
  90.  cright,10
  91.  cleft,14
  92.  sright,18
  93.  sleft,26
  94.  toggleinsert,39
  95.  delline,44
  96.  removeline,41
  97.  complete,50
  98.  completenext,51
  99.  completeprev,52
  100.  setmark,54
  101.  copy,56
  102.  swapmark,67
  103.  cut,76
  104.  deletenext,98
  105.  delete,111
  106.  wipehistory,123
  107.  deltoend,75
  108.  paste,128
  109.  swapchars,135
  110.  quote,148
  111.  vanilla,156
  112.  cup,171
  113.  cdown,180
  114.  up,196
  115.  down,211
  116.  sup,221
  117.  sdown,222
  118.  escape,223
  119.  fnkey,242
  120.  wipeallhistory,126
  121.  enter,231
  122.  return,235
  123.  uncopy,229
  124.  showcomp,47
  125.  completeshow,49
  126.